﻿@using ModalDownload.Models;
@{
    Layout = null;
    List<ADTable> list = ADTable.GetModels(ViewBag.Page, ViewBag.PageSize);
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>ManageAD</title>
    @Styles.Render("~/Content/admin/base.css")
    @Styles.Render("~/Content/admin/form.css")
</head>
<body>
    <div>
        <table id="tableList" class="editList" cellpadding="0" cellspacing="0">
            <tr>
                <td style="width:10%"></td>
                <td style="width:45%"></td>
                <td style="width:45%"></td>
            </tr>
			<tr>
				<td class="center" style="font-size:22px;" colspan="3">
                    广告管理
				</td>
			</tr>
			<tr class="head">
				<td class="center">
					广告位
				</td>
				<td class="center">
					启用
				</td>
				<td class="center">
					相 关 操 作
				</td>
			</tr>
            @foreach (ADTable model in list)
            {
                <tr class="alternate">
                    <td class="center">
                        @(model.title)
                    </td>
                    <td class="center">
                        @(model.valid?"是":"否")
                    </td>
                    <td class="center">
                        @Html.ActionLink("修改", "ADDetail", new { viewmode = "edit", id = model.ID })
                    </td>
                </tr>
            }
			<tr>
				<td class="center" colspan="3">
					总数：<b>@ViewBag.Total</b>&nbsp;&nbsp;&nbsp;&nbsp;
    @if (ViewBag.Page==1){
        @:首页&nbsp;&nbsp;&nbsp;&nbsp;上一页
    }
    else
    {
        @Html.ActionLink("首页", "ManageAD", "Admin", new { page="1"},null)
        @:&nbsp;&nbsp;&nbsp;&nbsp
        @Html.ActionLink("上一页", "ManageAD", "Admin", new { page=(ViewBag.Page-1)},null) 
    }
            &nbsp;&nbsp;&nbsp;&nbsp;
    @if (ViewBag.PageLength <= ViewBag.Page)
    {
        @:下一页&nbsp;&nbsp;&nbsp;&nbsp;尾页
    }
    else
    {
        @Html.ActionLink("下一页", "ManageAD", "Admin", new { page=(ViewBag.Page+1)},null)
        @:&nbsp;&nbsp;&nbsp;&nbsp
        @Html.ActionLink("尾页", "ManageAD", "Admin", new { page=ViewBag.PageLength},null) 
    }
    &nbsp;&nbsp;&nbsp;&nbsp;页: <b><font color="red">@ViewBag.Page</font>/@ViewBag.PageLength</b>
				</td>
			</tr>
		</table>
    </div>
</body>
</html>
